#include <iostream>

using namespace std;

struct A
{
	char c;
	int i;
	short s;
};

typedef union
{
	int ia;
	char c[4];
	short int s[2];
}untest; 

int main()
{
	cout << "sizeof(A) is " << sizeof(struct A) << endl;
	cout << "sizeof(int) is " << sizeof(int) << endl;

	untest un;
	un.c[0] = 0xAA; un.c[1] = 0xBB;
	un.c[2] = 0xCC; un.c[3] = 0xDD;
	cout << "un.ia=" << un.ia << endl;
	cout << "un.s[0]=" << un.s[0] << endl;

	return 0;
}
